# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.Compute.V1.Model.InterconnectAttachmentConfigurationConstraints do
  @moduledoc """


  ## Attributes

  *   `bgpMd5` (*type:* `String.t`, *default:* `nil`) - [Output Only] Whether the attachment's BGP session requires/allows/disallows BGP MD5 authentication. This can take one of the following values: MD5_OPTIONAL, MD5_REQUIRED, MD5_UNSUPPORTED. For example, a Cross-Cloud Interconnect connection to a remote cloud provider that requires BGP MD5 authentication has the interconnectRemoteLocation attachment_configuration_constraints.bgp_md5 field set to MD5_REQUIRED, and that property is propagated to the attachment. Similarly, if BGP MD5 is MD5_UNSUPPORTED, an error is returned if MD5 is requested.
  *   `bgpPeerAsnRanges` (*type:* `list(GoogleApi.Compute.V1.Model.InterconnectAttachmentConfigurationConstraintsBgpPeerASNRange.t)`, *default:* `nil`) - [Output Only] List of ASN ranges that the remote location is known to support. Formatted as an array of inclusive ranges {min: min-value, max: max-value}. For example, [{min: 123, max: 123}, {min: 64512, max: 65534}] allows the peer ASN to be 123 or anything in the range 64512-65534. This field is only advisory. Although the API accepts other ranges, these are the ranges that we recommend.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :bgpMd5 => String.t() | nil,
          :bgpPeerAsnRanges =>
            list(
              GoogleApi.Compute.V1.Model.InterconnectAttachmentConfigurationConstraintsBgpPeerASNRange.t()
            )
            | nil
        }

  field(:bgpMd5)

  field(:bgpPeerAsnRanges,
    as: GoogleApi.Compute.V1.Model.InterconnectAttachmentConfigurationConstraintsBgpPeerASNRange,
    type: :list
  )
end

defimpl Poison.Decoder,
  for: GoogleApi.Compute.V1.Model.InterconnectAttachmentConfigurationConstraints do
  def decode(value, options) do
    GoogleApi.Compute.V1.Model.InterconnectAttachmentConfigurationConstraints.decode(
      value,
      options
    )
  end
end

defimpl Poison.Encoder,
  for: GoogleApi.Compute.V1.Model.InterconnectAttachmentConfigurationConstraints do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
